﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Demo
{
    public class HocVien : INotifyPropertyChanged
    {
        private string name; // -> field
        private float score;
        public string Name // -> property
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
                if (PropertyChanged != null)
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Name"));
            }
        }

        public float Score
        {
            get
            {
                return score;
            }
            set
            {
                score = value;
                if (PropertyChanged != null)
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Score"));
            }
        }

        public HocVien()
        {

        }

        public HocVien(string name, float score)
        {
            this.Name = name;
            this.Score = score;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
